#define DEBUG
#include <cstdio>
#include <algorithm>
#define ADD(x, y) (x=((x)+(y))%mods)%mods;

using namespace std;

typedef long long ll;
const int maxn=40, maxd=100000, maxr=40, mods=1000000007;

ll fact[maxd+1], unfact[maxd+1];

ll qpower(ll a, int n) {
  ll s=1;
  for (; n; n/=2) {
    if (n&1) s=s*a%mods;
    a=a*a%mods;
  }
  return s;
}

void initFact(int n) {
  fact[0] = 1;
  for (int i=1; i<=n; i++) {
    fact[i] = fact[i-1]*i%mods;
  }
  unfact[n] = qpower(fact[n], mods-2);
  for (int i=n; i>0; i--) {
    unfact[i-1] = unfact[i]*i%mods;
  }
}

ll c(ll m, ll n) {
  if (m<0 || n<0 || m<n) return 0;
  return fact[m]*unfact[n]%mods*unfact[m-n]%mods;
}

int main() {
#ifdef DEBUG
  freopen("src.in", "r", stdin);
  freopen("src.out", "w", stdout);
#endif

  static int r[maxn+1];
  int n, d;
  scanf("%d %d", &n, &d);
  for (int i=1; i<=n; i++) scanf("%d", r+i);
  sort(r+1, r+n+1);

  static ll f[maxn+2][maxn*maxr+2][maxn+2][4];
  f[0][0][0][0] = 1;
  for (int i=1; i<=n; i++) {
    for (int j=0; j<=n*maxr; j++) {
      for (int k=0; k<=n; k++) {
        for (int x=0; x<4; x++) {
          if (k<n) {
            int t = x ? (x>2 ? k-1 : k) : k+1;
            ADD(f[i][j][k+1][x], t*f[i-1][j][k][x]%mods);
          }
          if ((k>1 || x<3) && k) {
            int t = x ? (x>2 ? 2*k-2 : 2*k-1) : 2*k;
            ADD(f[i][j+r[i]][k][x], t*f[i-1][j][k][x]%mods);
          }
          if (k>1) ADD(f[i][j+2*r[i]][k-1][x], (k-1)*f[i-1][j][k][x]%mods);
        }
        if (k<n) {
          ADD(f[i][j][k+1][1], f[i-1][j][k][0]);
          ADD(f[i][j][k+1][2], f[i-1][j][k][0]);
          ADD(f[i][j][k+1][3], f[i-1][j][k][1]+f[i-1][j][k][2]);
        }
        if (k) {
          ADD(f[i][j+r[i]][k][1], f[i-1][j][k][0]);
          ADD(f[i][j+r[i]][k][2], f[i-1][j][k][0]);
          ADD(f[i][j+r[i]][k][3], f[i-1][j][k][1]+f[i-1][j][k][2]);
        }
      }
    }
  }

  initFact(d);
  ll ans=0;
  for (int j=n-1; j<=n*maxr; j++) {
    ADD(ans, f[n][j][1][3]*c(d-j+n-1, n)%mods);
  }
  printf("%lld", ans);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
